﻿<UserControl x:Class="BallOnTiltablePlate.JanRapp.Controls.SettingSaver"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
          mc:Ignorable="d" Height="39" d:DesignWidth="290" Loaded="UserControl_Loaded">
    <UserControl.Resources>
        <RoutedCommand x:Key="SaveCmd">
            <RoutedCommand.InputGestures>
                <KeyGesture>Control+S</KeyGesture>
            </RoutedCommand.InputGestures>
        </RoutedCommand>
        <RoutedCommand x:Key="LoadCmd">
            <RoutedCommand.InputGestures>
                <KeyGesture>Control+L</KeyGesture>
            </RoutedCommand.InputGestures>
        </RoutedCommand>
        <RoutedCommand x:Key="FocusOnSettingSaver">
            <RoutedCommand.InputGestures>
                <KeyGesture>Control+F</KeyGesture>
            </RoutedCommand.InputGestures>
        </RoutedCommand>
        <RoutedCommand x:Key="LoadDefaultCmd">
            <RoutedCommand.InputGestures>
                <KeyGesture>Control+D</KeyGesture>
            </RoutedCommand.InputGestures>
        </RoutedCommand>
    </UserControl.Resources>
    <UserControl.CommandBindings>
        <CommandBinding Command="{StaticResource SaveCmd}"
                        CanExecute="SaveCmd_CanExecute"
                        Executed="SaveCmd_Executed" />
        <CommandBinding Command="{StaticResource LoadCmd}"
                        CanExecute="LoadCmd_CanExecute"
                        Executed="LoadCmd_Executed" />
        <CommandBinding Command="{StaticResource FocusOnSettingSaver}"
                        Executed="FocusOnSettingSaver_Executed"/>
        <CommandBinding Command="{StaticResource LoadDefaultCmd}"
                        Executed="LoadDefaultCmd_Executed"
                        CanExecute="LoadDefaultCmd_CanExecute"/>
    </UserControl.CommandBindings>
    <Grid>
        <ComboBox x:Name="InputComboBox"
                  SelectionChanged="box_SelectionChanged"
                  Margin="8,8,112,8"
                  IsEditable="True"
                  MinWidth="80"
                  ToolTip="Used to select (and load) previously saved configuartions or to enter a name for a new configuartion(Ctrl+S or 'Save' Button to save)."/>
        <Button Command="{StaticResource SaveCmd}"
                HorizontalAlignment="Right"
                Width="46"
                Margin="8"
                Content="Save"
                Padding="8,1"
                ToolTip="Saves the current Values set in the chiled controls associated with a name (Ctrl+S (from anywhere within))" />
        <Button Command="{StaticResource LoadCmd}"
                HorizontalAlignment="Right"
                Width="46"
                Margin="0,8,60,8"
                Content="Load"
                Padding="8,1"
                ToolTip="Loads the current values set in the child controls associated with the name (Ctrl+L (from anywhere within))" />
    </Grid>
</UserControl>
